FROM golang:1.23.2 AS builder
WORKDIR /app
COPY . .
RUN go env -w GOPROXY=https://goproxy.cn,direct  && go mod download && CGO_ENABLE=0 go build -o /output/main cmd/main.go

FROM ubuntu:22.04
WORKDIR /app
COPY --from=builder /output/main /app/
ENTRYPOINT ["/app/main"]